﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="false" CodeBehind="Default.aspx.cs" Inherits="Acme.Sakila.TestSite.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="pageblock">

<h1>nHydrate now supports MySql</h1>
<p>
This sample site demonstrates how to use a geneated API created with the nHydrate modeler platform. 
It uses a MySql database as its backend.
All error checking and prompting is model based. 
This site has very little code as the generated API and associated metadata defines almost all functionality. 
You may use this site to learn how to use the Entity Framwork based API to add, edit, and delete data. 
</p>

<div class="homepagefeature">

<div class="featurebox1">
<div align="center">
<img src="/images/mysql.jpg" alt="MySql" title="nHydrate supports MySql" />
</div>
</div>


<div class="featurebox2">
<div align="center">
<img src="/images/sqlserver.png" alt="Sql Server" title="nHydrate supports Sql Server" />
</div>

<p>
</p>
</div>

</div>

<h3>nHydrate MySql Sakila Sample</h3>

<div class="attentionbox roundblock">
<h3 class="roundblocktop">Site Features</h3>
<ul>
<li>Non-null fields are validated for existence</li>
<li>Strings are validated for length</li>
<li>Numbers are validated for type</li>
<li>Email (for Customer/Staff entity) is validated against a regular expression</li>
<li>Field labels are loaded from model and differ from field name</li>
<li>Removing objects with dependencies shows error (remove pre-defined Category)</li>
<li>Edit form controls are bound to entity objects of type 'BasePersistablePage'</li>
<li>All binding is strongly-typed with no 'Magic strings'</li>
<li>Validation is model based</li>
<li>Field prompts are model based</li>
</ul>
</div>

<div>
<h3>View the data schema</h3>
<div align="center">
<a href="/images/schema.png">
<img src="/images/schema.png" width="800" alt="Data Schema" />
</a>
</div>
</div>
<br /><br />

<p>
<strong>This sample site has not been fully developed. You cannot add and delete on every screen.</strong>
If you wish to add or delete data, use the <a href="/CategoryList.aspx">Categories Screen</a>. 
This list screen has an Add button for creating new items.
Each item in the list has a Delete link to remove individual items.
</p>

<h3>Direct Connection</h3>
<p>
This example was written against the Entity Framework DAL (data access layer). 
The connection string is setup in the &quot;Web.config&quot; file.
All of the queries can use LINQ directly against the DAL.
</p>

<h3>Dependency Walking</h3>
<p>
Using the DAL is easiest way to perform dependecy walking operations. 
You simply call the property for a related object or list from any other object. 
Notice that some objects have other object lists or items to related objects.
For example, the Customer object has an RentalList property because of its relation.
An Rental object has a back pointer to its parent Customer object.
</p>

<h3>Download</h3>
<p>
You can download this sample from CodePlex. It does require nHydrate to be installed in order to open the model.
<a href="http://bit.ly/OUp6Jm" target="_blank">CodePlex Download</a>
</p>

</div>
</asp:Content>
